<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2006-2016 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU libgomp: Top</title>

<meta name="description" content="GNU libgomp: Top">
<meta name="keywords" content="GNU libgomp: Top">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="#Top" rel="start" title="Top">
<link href="Library-Index.html#Library-Index" rel="index" title="Library Index">
<link href="#SEC_Contents" rel="contents" title="Table of Contents">
<link href="../dir/index.html" rel="up" title="(dir)">
<link href="Enabling-OpenMP.html#Enabling-OpenMP" rel="next" title="Enabling OpenMP">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<h1 class="settitle" align="center">GNU libgomp</h1>







<a name="SEC_Overview"></a>
<h2 class="shortcontents-heading">Short Table of Contents</h2>

<div class="shortcontents">
<ul class="no-bullet">
<li><a name="stoc-Enabling-OpenMP-1" href="#toc-Enabling-OpenMP-1">1 Enabling OpenMP</a></li>
<li><a name="stoc-Runtime-Library-Routines-1" href="#toc-Runtime-Library-Routines-1">2 Runtime Library Routines</a></li>
<li><a name="stoc-Environment-Variables-1" href="#toc-Environment-Variables-1">3 Environment Variables</a></li>
<li><a name="stoc-Enabling-OpenACC-1" href="#toc-Enabling-OpenACC-1">4 Enabling OpenACC</a></li>
<li><a name="stoc-OpenACC-Runtime-Library-Routines-1" href="#toc-OpenACC-Runtime-Library-Routines-1">5 OpenACC Runtime Library Routines</a></li>
<li><a name="stoc-OpenACC-Environment-Variables-1" href="#toc-OpenACC-Environment-Variables-1">6 OpenACC Environment Variables</a></li>
<li><a name="stoc-CUDA-Streams-Usage-1" href="#toc-CUDA-Streams-Usage-1">7 CUDA Streams Usage</a></li>
<li><a name="stoc-OpenACC-Library-Interoperability-1" href="#toc-OpenACC-Library-Interoperability-1">8 OpenACC Library Interoperability</a></li>
<li><a name="stoc-The-libgomp-ABI-1" href="#toc-The-libgomp-ABI-1">9 The libgomp ABI</a></li>
<li><a name="stoc-Reporting-Bugs-1" href="#toc-Reporting-Bugs-1">10 Reporting Bugs</a></li>
<li><a name="stoc-GNU-General-Public-License" href="#toc-GNU-General-Public-License">GNU General Public License</a></li>
<li><a name="stoc-GNU-Free-Documentation-License-1" href="#toc-GNU-Free-Documentation-License-1">GNU Free Documentation License</a></li>
<li><a name="stoc-Funding-Free-Software" href="#toc-Funding-Free-Software">Funding Free Software</a></li>
<li><a name="stoc-Library-Index-1" href="#toc-Library-Index-1">Library Index</a></li>
</ul>
</div>

<a name="SEC_Contents"></a>
<h2 class="contents-heading">Table of Contents</h2>

<div class="contents">

<ul class="no-bullet">
  <li><a name="toc-Enabling-OpenMP-1" href="Enabling-OpenMP.html#Enabling-OpenMP">1 Enabling OpenMP</a></li>
  <li><a name="toc-Runtime-Library-Routines-1" href="Runtime-Library-Routines.html#Runtime-Library-Routines">2 Runtime Library Routines</a>
  <ul class="no-bullet">
    <li><a name="toc-omp_005fget_005factive_005flevel-_002d_002d-Number-of-parallel-regions" href="omp_005fget_005factive_005flevel.html#omp_005fget_005factive_005flevel">2.1 <code>omp_get_active_level</code> &ndash; Number of parallel regions</a></li>
    <li><a name="toc-omp_005fget_005fancestor_005fthread_005fnum-_002d_002d-Ancestor-thread-ID" href="omp_005fget_005fancestor_005fthread_005fnum.html#omp_005fget_005fancestor_005fthread_005fnum">2.2 <code>omp_get_ancestor_thread_num</code> &ndash; Ancestor thread ID</a></li>
    <li><a name="toc-omp_005fget_005fcancellation-_002d_002d-Whether-cancellation-support-is-enabled" href="omp_005fget_005fcancellation.html#omp_005fget_005fcancellation">2.3 <code>omp_get_cancellation</code> &ndash; Whether cancellation support is enabled</a></li>
    <li><a name="toc-omp_005fget_005fdefault_005fdevice-_002d_002d-Get-the-default-device-for-target-regions" href="omp_005fget_005fdefault_005fdevice.html#omp_005fget_005fdefault_005fdevice">2.4 <code>omp_get_default_device</code> &ndash; Get the default device for target regions</a></li>
    <li><a name="toc-omp_005fget_005fdynamic-_002d_002d-Dynamic-teams-setting" href="omp_005fget_005fdynamic.html#omp_005fget_005fdynamic">2.5 <code>omp_get_dynamic</code> &ndash; Dynamic teams setting</a></li>
    <li><a name="toc-omp_005fget_005flevel-_002d_002d-Obtain-the-current-nesting-level" href="omp_005fget_005flevel.html#omp_005fget_005flevel">2.6 <code>omp_get_level</code> &ndash; Obtain the current nesting level</a></li>
    <li><a name="toc-omp_005fget_005fmax_005factive_005flevels-_002d_002d-Maximum-number-of-active-regions" href="omp_005fget_005fmax_005factive_005flevels.html#omp_005fget_005fmax_005factive_005flevels">2.7 <code>omp_get_max_active_levels</code> &ndash; Maximum number of active regions</a></li>
    <li><a name="toc-omp_005fget_005fmax_005ftask_005fpriority-_002d_002d-Maximum-priority-value" href="omp_005fget_005fmax_005ftask_005fpriority.html#omp_005fget_005fmax_005ftask_005fpriority">2.8 <code>omp_get_max_task_priority</code> &ndash; Maximum priority value</a></li>
    <li><a name="toc-omp_005fget_005fmax_005fthreads-_002d_002d-Maximum-number-of-threads-of-parallel-region" href="omp_005fget_005fmax_005fthreads.html#omp_005fget_005fmax_005fthreads">2.9 <code>omp_get_max_threads</code> &ndash; Maximum number of threads of parallel region</a></li>
    <li><a name="toc-omp_005fget_005fnested-_002d_002d-Nested-parallel-regions" href="omp_005fget_005fnested.html#omp_005fget_005fnested">2.10 <code>omp_get_nested</code> &ndash; Nested parallel regions</a></li>
    <li><a name="toc-omp_005fget_005fnum_005fdevices-_002d_002d-Number-of-target-devices" href="omp_005fget_005fnum_005fdevices.html#omp_005fget_005fnum_005fdevices">2.11 <code>omp_get_num_devices</code> &ndash; Number of target devices</a></li>
    <li><a name="toc-omp_005fget_005fnum_005fprocs-_002d_002d-Number-of-processors-online" href="omp_005fget_005fnum_005fprocs.html#omp_005fget_005fnum_005fprocs">2.12 <code>omp_get_num_procs</code> &ndash; Number of processors online</a></li>
    <li><a name="toc-omp_005fget_005fnum_005fteams-_002d_002d-Number-of-teams" href="omp_005fget_005fnum_005fteams.html#omp_005fget_005fnum_005fteams">2.13 <code>omp_get_num_teams</code> &ndash; Number of teams</a></li>
    <li><a name="toc-omp_005fget_005fnum_005fthreads-_002d_002d-Size-of-the-active-team" href="omp_005fget_005fnum_005fthreads.html#omp_005fget_005fnum_005fthreads">2.14 <code>omp_get_num_threads</code> &ndash; Size of the active team</a></li>
    <li><a name="toc-omp_005fget_005fproc_005fbind-_002d_002d-Whether-theads-may-be-moved-between-CPUs" href="omp_005fget_005fproc_005fbind.html#omp_005fget_005fproc_005fbind">2.15 <code>omp_get_proc_bind</code> &ndash; Whether theads may be moved between CPUs</a></li>
    <li><a name="toc-omp_005fget_005fschedule-_002d_002d-Obtain-the-runtime-scheduling-method" href="omp_005fget_005fschedule.html#omp_005fget_005fschedule">2.16 <code>omp_get_schedule</code> &ndash; Obtain the runtime scheduling method</a></li>
    <li><a name="toc-omp_005fget_005fteam_005fnum-_002d_002d-Get-team-number" href="omp_005fget_005fteam_005fnum.html#omp_005fget_005fteam_005fnum">2.17 <code>omp_get_team_num</code> &ndash; Get team number</a></li>
    <li><a name="toc-omp_005fget_005fteam_005fsize-_002d_002d-Number-of-threads-in-a-team" href="omp_005fget_005fteam_005fsize.html#omp_005fget_005fteam_005fsize">2.18 <code>omp_get_team_size</code> &ndash; Number of threads in a team</a></li>
    <li><a name="toc-omp_005fget_005fthread_005flimit-_002d_002d-Maximum-number-of-threads" href="omp_005fget_005fthread_005flimit.html#omp_005fget_005fthread_005flimit">2.19 <code>omp_get_thread_limit</code> &ndash; Maximum number of threads</a></li>
    <li><a name="toc-omp_005fget_005fthread_005fnum-_002d_002d-Current-thread-ID" href="omp_005fget_005fthread_005fnum.html#omp_005fget_005fthread_005fnum">2.20 <code>omp_get_thread_num</code> &ndash; Current thread ID</a></li>
    <li><a name="toc-omp_005fin_005fparallel-_002d_002d-Whether-a-parallel-region-is-active" href="omp_005fin_005fparallel.html#omp_005fin_005fparallel">2.21 <code>omp_in_parallel</code> &ndash; Whether a parallel region is active</a></li>
    <li><a name="toc-omp_005fin_005ffinal-_002d_002d-Whether-in-final-or-included-task-region" href="omp_005fin_005ffinal.html#omp_005fin_005ffinal">2.22 <code>omp_in_final</code> &ndash; Whether in final or included task region</a></li>
    <li><a name="toc-omp_005fis_005finitial_005fdevice-_002d_002d-Whether-executing-on-the-host-device" href="omp_005fis_005finitial_005fdevice.html#omp_005fis_005finitial_005fdevice">2.23 <code>omp_is_initial_device</code> &ndash; Whether executing on the host device</a></li>
    <li><a name="toc-omp_005fset_005fdefault_005fdevice-_002d_002d-Set-the-default-device-for-target-regions" href="omp_005fset_005fdefault_005fdevice.html#omp_005fset_005fdefault_005fdevice">2.24 <code>omp_set_default_device</code> &ndash; Set the default device for target regions</a></li>
    <li><a name="toc-omp_005fset_005fdynamic-_002d_002d-Enable_002fdisable-dynamic-teams" href="omp_005fset_005fdynamic.html#omp_005fset_005fdynamic">2.25 <code>omp_set_dynamic</code> &ndash; Enable/disable dynamic teams</a></li>
    <li><a name="toc-omp_005fset_005fmax_005factive_005flevels-_002d_002d-Limits-the-number-of-active-parallel-regions" href="omp_005fset_005fmax_005factive_005flevels.html#omp_005fset_005fmax_005factive_005flevels">2.26 <code>omp_set_max_active_levels</code> &ndash; Limits the number of active parallel regions</a></li>
    <li><a name="toc-omp_005fset_005fnested-_002d_002d-Enable_002fdisable-nested-parallel-regions" href="omp_005fset_005fnested.html#omp_005fset_005fnested">2.27 <code>omp_set_nested</code> &ndash; Enable/disable nested parallel regions</a></li>
    <li><a name="toc-omp_005fset_005fnum_005fthreads-_002d_002d-Set-upper-team-size-limit" href="omp_005fset_005fnum_005fthreads.html#omp_005fset_005fnum_005fthreads">2.28 <code>omp_set_num_threads</code> &ndash; Set upper team size limit</a></li>
    <li><a name="toc-omp_005fset_005fschedule-_002d_002d-Set-the-runtime-scheduling-method" href="omp_005fset_005fschedule.html#omp_005fset_005fschedule">2.29 <code>omp_set_schedule</code> &ndash; Set the runtime scheduling method</a></li>
    <li><a name="toc-omp_005finit_005flock-_002d_002d-Initialize-simple-lock" href="omp_005finit_005flock.html#omp_005finit_005flock">2.30 <code>omp_init_lock</code> &ndash; Initialize simple lock</a></li>
    <li><a name="toc-omp_005fset_005flock-_002d_002d-Wait-for-and-set-simple-lock" href="omp_005fset_005flock.html#omp_005fset_005flock">2.31 <code>omp_set_lock</code> &ndash; Wait for and set simple lock</a></li>
    <li><a name="toc-omp_005ftest_005flock-_002d_002d-Test-and-set-simple-lock-if-available" href="omp_005ftest_005flock.html#omp_005ftest_005flock">2.32 <code>omp_test_lock</code> &ndash; Test and set simple lock if available</a></li>
    <li><a name="toc-omp_005funset_005flock-_002d_002d-Unset-simple-lock" href="omp_005funset_005flock.html#omp_005funset_005flock">2.33 <code>omp_unset_lock</code> &ndash; Unset simple lock</a></li>
    <li><a name="toc-omp_005fdestroy_005flock-_002d_002d-Destroy-simple-lock" href="omp_005fdestroy_005flock.html#omp_005fdestroy_005flock">2.34 <code>omp_destroy_lock</code> &ndash; Destroy simple lock</a></li>
    <li><a name="toc-omp_005finit_005fnest_005flock-_002d_002d-Initialize-nested-lock" href="omp_005finit_005fnest_005flock.html#omp_005finit_005fnest_005flock">2.35 <code>omp_init_nest_lock</code> &ndash; Initialize nested lock</a></li>
    <li><a name="toc-omp_005fset_005fnest_005flock-_002d_002d-Wait-for-and-set-nested-lock" href="omp_005fset_005fnest_005flock.html#omp_005fset_005fnest_005flock">2.36 <code>omp_set_nest_lock</code> &ndash; Wait for and set nested lock</a></li>
    <li><a name="toc-omp_005ftest_005fnest_005flock-_002d_002d-Test-and-set-nested-lock-if-available" href="omp_005ftest_005fnest_005flock.html#omp_005ftest_005fnest_005flock">2.37 <code>omp_test_nest_lock</code> &ndash; Test and set nested lock if available</a></li>
    <li><a name="toc-omp_005funset_005fnest_005flock-_002d_002d-Unset-nested-lock" href="omp_005funset_005fnest_005flock.html#omp_005funset_005fnest_005flock">2.38 <code>omp_unset_nest_lock</code> &ndash; Unset nested lock</a></li>
    <li><a name="toc-omp_005fdestroy_005fnest_005flock-_002d_002d-Destroy-nested-lock" href="omp_005fdestroy_005fnest_005flock.html#omp_005fdestroy_005fnest_005flock">2.39 <code>omp_destroy_nest_lock</code> &ndash; Destroy nested lock</a></li>
    <li><a name="toc-omp_005fget_005fwtick-_002d_002d-Get-timer-precision" href="omp_005fget_005fwtick.html#omp_005fget_005fwtick">2.40 <code>omp_get_wtick</code> &ndash; Get timer precision</a></li>
    <li><a name="toc-omp_005fget_005fwtime-_002d_002d-Elapsed-wall-clock-time" href="omp_005fget_005fwtime.html#omp_005fget_005fwtime">2.41 <code>omp_get_wtime</code> &ndash; Elapsed wall clock time</a></li>
  </ul></li>
  <li><a name="toc-Environment-Variables-1" href="Environment-Variables.html#Environment-Variables">3 Environment Variables</a>
  <ul class="no-bullet">
    <li><a name="toc-OMP_005fCANCELLATION-_002d_002d-Set-whether-cancellation-is-activated" href="OMP_005fCANCELLATION.html#OMP_005fCANCELLATION">3.1 <code>OMP_CANCELLATION</code> &ndash; Set whether cancellation is activated</a></li>
    <li><a name="toc-OMP_005fDISPLAY_005fENV-_002d_002d-Show-OpenMP-version-and-environment-variables" href="OMP_005fDISPLAY_005fENV.html#OMP_005fDISPLAY_005fENV">3.2 <code>OMP_DISPLAY_ENV</code> &ndash; Show OpenMP version and environment variables</a></li>
    <li><a name="toc-OMP_005fDEFAULT_005fDEVICE-_002d_002d-Set-the-device-used-in-target-regions" href="OMP_005fDEFAULT_005fDEVICE.html#OMP_005fDEFAULT_005fDEVICE">3.3 <code>OMP_DEFAULT_DEVICE</code> &ndash; Set the device used in target regions</a></li>
    <li><a name="toc-OMP_005fDYNAMIC-_002d_002d-Dynamic-adjustment-of-threads" href="OMP_005fDYNAMIC.html#OMP_005fDYNAMIC">3.4 <code>OMP_DYNAMIC</code> &ndash; Dynamic adjustment of threads</a></li>
    <li><a name="toc-OMP_005fMAX_005fACTIVE_005fLEVELS-_002d_002d-Set-the-maximum-number-of-nested-parallel-regions" href="OMP_005fMAX_005fACTIVE_005fLEVELS.html#OMP_005fMAX_005fACTIVE_005fLEVELS">3.5 <code>OMP_MAX_ACTIVE_LEVELS</code> &ndash; Set the maximum number of nested parallel regions</a></li>
    <li><a name="toc-OMP_005fMAX_005fTASK_005fPRIORITY-_002d_002d-Set-the-maximum-priority" href="OMP_005fMAX_005fTASK_005fPRIORITY.html#OMP_005fMAX_005fTASK_005fPRIORITY">3.6 <code>OMP_MAX_TASK_PRIORITY</code> &ndash; Set the maximum priority</a></li>
    <li><a name="toc-OMP_005fNESTED-_002d_002d-Nested-parallel-regions" href="OMP_005fNESTED.html#OMP_005fNESTED">3.7 <code>OMP_NESTED</code> &ndash; Nested parallel regions</a></li>
    <li><a name="toc-OMP_005fNUM_005fTHREADS-_002d_002d-Specifies-the-number-of-threads-to-use" href="OMP_005fNUM_005fTHREADS.html#OMP_005fNUM_005fTHREADS">3.8 <code>OMP_NUM_THREADS</code> &ndash; Specifies the number of threads to use</a></li>
    <li><a name="toc-OMP_005fPROC_005fBIND-_002d_002d-Whether-theads-may-be-moved-between-CPUs" href="OMP_005fPROC_005fBIND.html#OMP_005fPROC_005fBIND">3.9 <code>OMP_PROC_BIND</code> &ndash; Whether theads may be moved between CPUs</a></li>
    <li><a name="toc-OMP_005fPLACES-_002d_002d-Specifies-on-which-CPUs-the-theads-should-be-placed" href="OMP_005fPLACES.html#OMP_005fPLACES">3.10 <code>OMP_PLACES</code> &ndash; Specifies on which CPUs the theads should be placed</a></li>
    <li><a name="toc-OMP_005fSTACKSIZE-_002d_002d-Set-default-thread-stack-size" href="OMP_005fSTACKSIZE.html#OMP_005fSTACKSIZE">3.11 <code>OMP_STACKSIZE</code> &ndash; Set default thread stack size</a></li>
    <li><a name="toc-OMP_005fSCHEDULE-_002d_002d-How-threads-are-scheduled" href="OMP_005fSCHEDULE.html#OMP_005fSCHEDULE">3.12 <code>OMP_SCHEDULE</code> &ndash; How threads are scheduled</a></li>
    <li><a name="toc-OMP_005fTHREAD_005fLIMIT-_002d_002d-Set-the-maximum-number-of-threads" href="OMP_005fTHREAD_005fLIMIT.html#OMP_005fTHREAD_005fLIMIT">3.13 <code>OMP_THREAD_LIMIT</code> &ndash; Set the maximum number of threads</a></li>
    <li><a name="toc-OMP_005fWAIT_005fPOLICY-_002d_002d-How-waiting-threads-are-handled" href="OMP_005fWAIT_005fPOLICY.html#OMP_005fWAIT_005fPOLICY">3.14 <code>OMP_WAIT_POLICY</code> &ndash; How waiting threads are handled</a></li>
    <li><a name="toc-GOMP_005fCPU_005fAFFINITY-_002d_002d-Bind-threads-to-specific-CPUs" href="GOMP_005fCPU_005fAFFINITY.html#GOMP_005fCPU_005fAFFINITY">3.15 <code>GOMP_CPU_AFFINITY</code> &ndash; Bind threads to specific CPUs</a></li>
    <li><a name="toc-GOMP_005fDEBUG-_002d_002d-Enable-debugging-output" href="GOMP_005fDEBUG.html#GOMP_005fDEBUG">3.16 <code>GOMP_DEBUG</code> &ndash; Enable debugging output</a></li>
    <li><a name="toc-GOMP_005fSTACKSIZE-_002d_002d-Set-default-thread-stack-size" href="GOMP_005fSTACKSIZE.html#GOMP_005fSTACKSIZE">3.17 <code>GOMP_STACKSIZE</code> &ndash; Set default thread stack size</a></li>
    <li><a name="toc-GOMP_005fSPINCOUNT-_002d_002d-Set-the-busy_002dwait-spin-count" href="GOMP_005fSPINCOUNT.html#GOMP_005fSPINCOUNT">3.18 <code>GOMP_SPINCOUNT</code> &ndash; Set the busy-wait spin count</a></li>
    <li><a name="toc-GOMP_005fRTEMS_005fTHREAD_005fPOOLS-_002d_002d-Set-the-RTEMS-specific-thread-pools" href="GOMP_005fRTEMS_005fTHREAD_005fPOOLS.html#GOMP_005fRTEMS_005fTHREAD_005fPOOLS">3.19 <code>GOMP_RTEMS_THREAD_POOLS</code> &ndash; Set the RTEMS specific thread pools</a></li>
  </ul></li>
  <li><a name="toc-Enabling-OpenACC-1" href="Enabling-OpenACC.html#Enabling-OpenACC">4 Enabling OpenACC</a></li>
  <li><a name="toc-OpenACC-Runtime-Library-Routines-1" href="OpenACC-Runtime-Library-Routines.html#OpenACC-Runtime-Library-Routines">5 OpenACC Runtime Library Routines</a>
  <ul class="no-bullet">
    <li><a name="toc-acc_005fget_005fnum_005fdevices-_002d_002d-Get-number-of-devices-for-given-device-type" href="acc_005fget_005fnum_005fdevices.html#acc_005fget_005fnum_005fdevices">5.1 <code>acc_get_num_devices</code> &ndash; Get number of devices for given device type</a></li>
    <li><a name="toc-acc_005fset_005fdevice_005ftype-_002d_002d-Set-type-of-device-accelerator-to-use_002e" href="acc_005fset_005fdevice_005ftype.html#acc_005fset_005fdevice_005ftype">5.2 <code>acc_set_device_type</code> &ndash; Set type of device accelerator to use.</a></li>
    <li><a name="toc-acc_005fget_005fdevice_005ftype-_002d_002d-Get-type-of-device-accelerator-to-be-used_002e" href="acc_005fget_005fdevice_005ftype.html#acc_005fget_005fdevice_005ftype">5.3 <code>acc_get_device_type</code> &ndash; Get type of device accelerator to be used.</a></li>
    <li><a name="toc-acc_005fset_005fdevice_005fnum-_002d_002d-Set-device-number-to-use_002e" href="acc_005fset_005fdevice_005fnum.html#acc_005fset_005fdevice_005fnum">5.4 <code>acc_set_device_num</code> &ndash; Set device number to use.</a></li>
    <li><a name="toc-acc_005fget_005fdevice_005fnum-_002d_002d-Get-device-number-to-be-used_002e" href="acc_005fget_005fdevice_005fnum.html#acc_005fget_005fdevice_005fnum">5.5 <code>acc_get_device_num</code> &ndash; Get device number to be used.</a></li>
    <li><a name="toc-acc_005fasync_005ftest-_002d_002d-Test-for-completion-of-a-specific-asynchronous-operation_002e" href="acc_005fasync_005ftest.html#acc_005fasync_005ftest">5.6 <code>acc_async_test</code> &ndash; Test for completion of a specific asynchronous operation.</a></li>
    <li><a name="toc-acc_005fasync_005ftest_005fall-_002d_002d-Tests-for-completion-of-all-asynchronous-operations_002e" href="acc_005fasync_005ftest_005fall.html#acc_005fasync_005ftest_005fall">5.7 <code>acc_async_test_all</code> &ndash; Tests for completion of all asynchronous operations.</a></li>
    <li><a name="toc-acc_005fwait-_002d_002d-Wait-for-completion-of-a-specific-asynchronous-operation_002e" href="acc_005fwait.html#acc_005fwait">5.8 <code>acc_wait</code> &ndash; Wait for completion of a specific asynchronous operation.</a></li>
    <li><a name="toc-acc_005fwait_005fall-_002d_002d-Waits-for-completion-of-all-asynchronous-operations_002e" href="acc_005fwait_005fall.html#acc_005fwait_005fall">5.9 <code>acc_wait_all</code> &ndash; Waits for completion of all asynchronous operations.</a></li>
    <li><a name="toc-acc_005fwait_005fall_005fasync-_002d_002d-Wait-for-completion-of-all-asynchronous-operations_002e" href="acc_005fwait_005fall_005fasync.html#acc_005fwait_005fall_005fasync">5.10 <code>acc_wait_all_async</code> &ndash; Wait for completion of all asynchronous operations.</a></li>
    <li><a name="toc-acc_005fwait_005fasync-_002d_002d-Wait-for-completion-of-asynchronous-operations_002e" href="acc_005fwait_005fasync.html#acc_005fwait_005fasync">5.11 <code>acc_wait_async</code> &ndash; Wait for completion of asynchronous operations.</a></li>
    <li><a name="toc-acc_005finit-_002d_002d-Initialize-runtime-for-a-specific-device-type_002e" href="acc_005finit.html#acc_005finit">5.12 <code>acc_init</code> &ndash; Initialize runtime for a specific device type.</a></li>
    <li><a name="toc-acc_005fshutdown-_002d_002d-Shuts-down-the-runtime-for-a-specific-device-type_002e" href="acc_005fshutdown.html#acc_005fshutdown">5.13 <code>acc_shutdown</code> &ndash; Shuts down the runtime for a specific device type.</a></li>
    <li><a name="toc-acc_005fon_005fdevice-_002d_002d-Whether-executing-on-a-particular-device" href="acc_005fon_005fdevice.html#acc_005fon_005fdevice">5.14 <code>acc_on_device</code> &ndash; Whether executing on a particular device</a></li>
    <li><a name="toc-acc_005fmalloc-_002d_002d-Allocate-device-memory_002e" href="acc_005fmalloc.html#acc_005fmalloc">5.15 <code>acc_malloc</code> &ndash; Allocate device memory.</a></li>
    <li><a name="toc-acc_005ffree-_002d_002d-Free-device-memory_002e" href="acc_005ffree.html#acc_005ffree">5.16 <code>acc_free</code> &ndash; Free device memory.</a></li>
    <li><a name="toc-acc_005fcopyin-_002d_002d-Allocate-device-memory-and-copy-host-memory-to-it_002e" href="acc_005fcopyin.html#acc_005fcopyin">5.17 <code>acc_copyin</code> &ndash; Allocate device memory and copy host memory to it.</a></li>
    <li><a name="toc-acc_005fpresent_005for_005fcopyin-_002d_002d-If-the-data-is-not-present-on-the-device_002c-allocate-device-memory-and-copy-from-host-memory_002e" href="acc_005fpresent_005for_005fcopyin.html#acc_005fpresent_005for_005fcopyin">5.18 <code>acc_present_or_copyin</code> &ndash; If the data is not present on the device, allocate device memory and copy from host memory.</a></li>
    <li><a name="toc-acc_005fcreate-_002d_002d-Allocate-device-memory-and-map-it-to-host-memory_002e" href="acc_005fcreate.html#acc_005fcreate">5.19 <code>acc_create</code> &ndash; Allocate device memory and map it to host memory.</a></li>
    <li><a name="toc-acc_005fpresent_005for_005fcreate-_002d_002d-If-the-data-is-not-present-on-the-device_002c-allocate-device-memory-and-map-it-to-host-memory_002e" href="acc_005fpresent_005for_005fcreate.html#acc_005fpresent_005for_005fcreate">5.20 <code>acc_present_or_create</code> &ndash; If the data is not present on the device, allocate device memory and map it to host memory.</a></li>
    <li><a name="toc-acc_005fcopyout-_002d_002d-Copy-device-memory-to-host-memory_002e" href="acc_005fcopyout.html#acc_005fcopyout">5.21 <code>acc_copyout</code> &ndash; Copy device memory to host memory.</a></li>
    <li><a name="toc-acc_005fdelete-_002d_002d-Free-device-memory_002e" href="acc_005fdelete.html#acc_005fdelete">5.22 <code>acc_delete</code> &ndash; Free device memory.</a></li>
    <li><a name="toc-acc_005fupdate_005fdevice-_002d_002d-Update-device-memory-from-mapped-host-memory_002e" href="acc_005fupdate_005fdevice.html#acc_005fupdate_005fdevice">5.23 <code>acc_update_device</code> &ndash; Update device memory from mapped host memory.</a></li>
    <li><a name="toc-acc_005fupdate_005fself-_002d_002d-Update-host-memory-from-mapped-device-memory_002e" href="acc_005fupdate_005fself.html#acc_005fupdate_005fself">5.24 <code>acc_update_self</code> &ndash; Update host memory from mapped device memory.</a></li>
    <li><a name="toc-acc_005fmap_005fdata-_002d_002d-Map-previously-allocated-device-memory-to-host-memory_002e" href="acc_005fmap_005fdata.html#acc_005fmap_005fdata">5.25 <code>acc_map_data</code> &ndash; Map previously allocated device memory to host memory.</a></li>
    <li><a name="toc-acc_005funmap_005fdata-_002d_002d-Unmap-device-memory-from-host-memory_002e" href="acc_005funmap_005fdata.html#acc_005funmap_005fdata">5.26 <code>acc_unmap_data</code> &ndash; Unmap device memory from host memory.</a></li>
    <li><a name="toc-acc_005fdeviceptr-_002d_002d-Get-device-pointer-associated-with-specific-host-address_002e" href="acc_005fdeviceptr.html#acc_005fdeviceptr">5.27 <code>acc_deviceptr</code> &ndash; Get device pointer associated with specific host address.</a></li>
    <li><a name="toc-acc_005fhostptr-_002d_002d-Get-host-pointer-associated-with-specific-device-address_002e" href="acc_005fhostptr.html#acc_005fhostptr">5.28 <code>acc_hostptr</code> &ndash; Get host pointer associated with specific device address.</a></li>
    <li><a name="toc-acc_005fis_005fpresent-_002d_002d-Indicate-whether-host-variable-_002f-array-is-present-on-device_002e" href="acc_005fis_005fpresent.html#acc_005fis_005fpresent">5.29 <code>acc_is_present</code> &ndash; Indicate whether host variable / array is present on device.</a></li>
    <li><a name="toc-acc_005fmemcpy_005fto_005fdevice-_002d_002d-Copy-host-memory-to-device-memory_002e" href="acc_005fmemcpy_005fto_005fdevice.html#acc_005fmemcpy_005fto_005fdevice">5.30 <code>acc_memcpy_to_device</code> &ndash; Copy host memory to device memory.</a></li>
    <li><a name="toc-acc_005fmemcpy_005ffrom_005fdevice-_002d_002d-Copy-device-memory-to-host-memory_002e" href="acc_005fmemcpy_005ffrom_005fdevice.html#acc_005fmemcpy_005ffrom_005fdevice">5.31 <code>acc_memcpy_from_device</code> &ndash; Copy device memory to host memory.</a></li>
    <li><a name="toc-acc_005fget_005fcurrent_005fcuda_005fdevice-_002d_002d-Get-CUDA-device-handle_002e" href="acc_005fget_005fcurrent_005fcuda_005fdevice.html#acc_005fget_005fcurrent_005fcuda_005fdevice">5.32 <code>acc_get_current_cuda_device</code> &ndash; Get CUDA device handle.</a></li>
    <li><a name="toc-acc_005fget_005fcurrent_005fcuda_005fcontext-_002d_002d-Get-CUDA-context-handle_002e" href="acc_005fget_005fcurrent_005fcuda_005fcontext.html#acc_005fget_005fcurrent_005fcuda_005fcontext">5.33 <code>acc_get_current_cuda_context</code> &ndash; Get CUDA context handle.</a></li>
    <li><a name="toc-acc_005fget_005fcuda_005fstream-_002d_002d-Get-CUDA-stream-handle_002e" href="acc_005fget_005fcuda_005fstream.html#acc_005fget_005fcuda_005fstream">5.34 <code>acc_get_cuda_stream</code> &ndash; Get CUDA stream handle.</a></li>
    <li><a name="toc-acc_005fset_005fcuda_005fstream-_002d_002d-Set-CUDA-stream-handle_002e" href="acc_005fset_005fcuda_005fstream.html#acc_005fset_005fcuda_005fstream">5.35 <code>acc_set_cuda_stream</code> &ndash; Set CUDA stream handle.</a></li>
  </ul></li>
  <li><a name="toc-OpenACC-Environment-Variables-1" href="OpenACC-Environment-Variables.html#OpenACC-Environment-Variables">6 OpenACC Environment Variables</a>
  <ul class="no-bullet">
    <li><a name="toc-ACC_005fDEVICE_005fTYPE-1" href="ACC_005fDEVICE_005fTYPE.html#ACC_005fDEVICE_005fTYPE">6.1 <code>ACC_DEVICE_TYPE</code></a></li>
    <li><a name="toc-ACC_005fDEVICE_005fNUM-1" href="ACC_005fDEVICE_005fNUM.html#ACC_005fDEVICE_005fNUM">6.2 <code>ACC_DEVICE_NUM</code></a></li>
    <li><a name="toc-GCC_005fACC_005fNOTIFY-1" href="GCC_005fACC_005fNOTIFY.html#GCC_005fACC_005fNOTIFY">6.3 <code>GCC_ACC_NOTIFY</code></a></li>
  </ul></li>
  <li><a name="toc-CUDA-Streams-Usage-1" href="CUDA-Streams-Usage.html#CUDA-Streams-Usage">7 CUDA Streams Usage</a></li>
  <li><a name="toc-OpenACC-Library-Interoperability-1" href="OpenACC-Library-Interoperability.html#OpenACC-Library-Interoperability">8 OpenACC Library Interoperability</a>
  <ul class="no-bullet">
    <li><a name="toc-Introduction-1" href="OpenACC-Library-Interoperability.html#Introduction-1">8.1 Introduction</a></li>
    <li><a name="toc-First-invocation_003a-NVIDIA-CUBLAS-library-API" href="OpenACC-Library-Interoperability.html#First-invocation_003a-NVIDIA-CUBLAS-library-API">8.2 First invocation: NVIDIA CUBLAS library API</a></li>
    <li><a name="toc-First-invocation_003a-OpenACC-library-API" href="OpenACC-Library-Interoperability.html#First-invocation_003a-OpenACC-library-API">8.3 First invocation: OpenACC library API</a></li>
    <li><a name="toc-OpenACC-library-and-environment-variables" href="OpenACC-Library-Interoperability.html#OpenACC-library-and-environment-variables">8.4 OpenACC library and environment variables</a></li>
  </ul></li>
  <li><a name="toc-The-libgomp-ABI-1" href="The-libgomp-ABI.html#The-libgomp-ABI">9 The libgomp ABI</a>
  <ul class="no-bullet">
    <li><a name="toc-Implementing-MASTER-construct-1" href="Implementing-MASTER-construct.html#Implementing-MASTER-construct">9.1 Implementing MASTER construct</a></li>
    <li><a name="toc-Implementing-CRITICAL-construct-1" href="Implementing-CRITICAL-construct.html#Implementing-CRITICAL-construct">9.2 Implementing CRITICAL construct</a></li>
    <li><a name="toc-Implementing-ATOMIC-construct-1" href="Implementing-ATOMIC-construct.html#Implementing-ATOMIC-construct">9.3 Implementing ATOMIC construct</a></li>
    <li><a name="toc-Implementing-FLUSH-construct-1" href="Implementing-FLUSH-construct.html#Implementing-FLUSH-construct">9.4 Implementing FLUSH construct</a></li>
    <li><a name="toc-Implementing-BARRIER-construct-1" href="Implementing-BARRIER-construct.html#Implementing-BARRIER-construct">9.5 Implementing BARRIER construct</a></li>
    <li><a name="toc-Implementing-THREADPRIVATE-construct-1" href="Implementing-THREADPRIVATE-construct.html#Implementing-THREADPRIVATE-construct">9.6 Implementing THREADPRIVATE construct</a></li>
    <li><a name="toc-Implementing-PRIVATE-clause-1" href="Implementing-PRIVATE-clause.html#Implementing-PRIVATE-clause">9.7 Implementing PRIVATE clause</a></li>
    <li><a name="toc-Implementing-FIRSTPRIVATE-LASTPRIVATE-COPYIN-and-COPYPRIVATE-clauses-1" href="Implementing-FIRSTPRIVATE-LASTPRIVATE-COPYIN-and-COPYPRIVATE-clauses.html#Implementing-FIRSTPRIVATE-LASTPRIVATE-COPYIN-and-COPYPRIVATE-clauses">9.8 Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses</a></li>
    <li><a name="toc-Implementing-REDUCTION-clause-1" href="Implementing-REDUCTION-clause.html#Implementing-REDUCTION-clause">9.9 Implementing REDUCTION clause</a></li>
    <li><a name="toc-Implementing-PARALLEL-construct-1" href="Implementing-PARALLEL-construct.html#Implementing-PARALLEL-construct">9.10 Implementing PARALLEL construct</a></li>
    <li><a name="toc-Implementing-FOR-construct-1" href="Implementing-FOR-construct.html#Implementing-FOR-construct">9.11 Implementing FOR construct</a></li>
    <li><a name="toc-Implementing-ORDERED-construct-1" href="Implementing-ORDERED-construct.html#Implementing-ORDERED-construct">9.12 Implementing ORDERED construct</a></li>
    <li><a name="toc-Implementing-SECTIONS-construct-1" href="Implementing-SECTIONS-construct.html#Implementing-SECTIONS-construct">9.13 Implementing SECTIONS construct</a></li>
    <li><a name="toc-Implementing-SINGLE-construct-1" href="Implementing-SINGLE-construct.html#Implementing-SINGLE-construct">9.14 Implementing SINGLE construct</a></li>
    <li><a name="toc-Implementing-OpenACC_0027s-PARALLEL-construct-1" href="Implementing-OpenACC_0027s-PARALLEL-construct.html#Implementing-OpenACC_0027s-PARALLEL-construct">9.15 Implementing OpenACC&rsquo;s PARALLEL construct</a></li>
  </ul></li>
  <li><a name="toc-Reporting-Bugs-1" href="Reporting-Bugs.html#Reporting-Bugs">10 Reporting Bugs</a></li>
  <li><a name="toc-GNU-General-Public-License" href="Copying.html#Copying">GNU General Public License</a></li>
  <li><a name="toc-GNU-Free-Documentation-License-1" href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License">GNU Free Documentation License</a>
  <ul class="no-bullet">
    <li><a name="toc-ADDENDUM_003a-How-to-use-this-License-for-your-documents" href="GNU-Free-Documentation-License.html#ADDENDUM_003a-How-to-use-this-License-for-your-documents">ADDENDUM: How to use this License for your documents</a></li>
  </ul></li>
  <li><a name="toc-Funding-Free-Software" href="Funding.html#Funding">Funding Free Software</a></li>
  <li><a name="toc-Library-Index-1" href="Library-Index.html#Library-Index">Library Index</a></li>
</ul>
</div>



<a name="Top"></a>
<div class="header">
<p>
Next: <a href="Enabling-OpenMP.html#Enabling-OpenMP" accesskey="n" rel="next">Enabling OpenMP</a>, Up: <a href="../dir/index.html" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Library-Index.html#Library-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Introduction"></a>
<h1 class="top">Introduction</h1>
<a name="index-Introduction"></a>

<p>This manual documents the usage of libgomp, the GNU Offloading and
Multi Processing Runtime Library.  This includes the GNU
implementation of the <a href="http://www.openmp.org">OpenMP</a> Application
Programming Interface (API) for multi-platform shared-memory parallel
programming in C/C++ and Fortran, and the GNU implementation of the
<a href="http://www.openacc.org/">OpenACC</a> Application Programming
Interface (API) for offloading of code to accelerator devices in C/C++
and Fortran.
</p>
<p>Originally, libgomp implemented the GNU OpenMP Runtime Library.  Based
on this, support for OpenACC and offloading (both OpenACC and OpenMP
4&rsquo;s target construct) has been added later on, and the library&rsquo;s name
changed to GNU Offloading and Multi Processing Runtime Library.
</p>


<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="Enabling-OpenMP.html#Enabling-OpenMP" accesskey="1">Enabling OpenMP</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to enable OpenMP for your applications.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Runtime-Library-Routines.html#Runtime-Library-Routines" accesskey="2">Runtime Library Routines</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The OpenMP runtime application programming 
                               interface.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Environment-Variables.html#Environment-Variables" accesskey="3">Environment Variables</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Influencing runtime behavior with environment 
                               variables.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Enabling-OpenACC.html#Enabling-OpenACC" accesskey="4">Enabling OpenACC</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to enable OpenACC for your
                               applications.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="OpenACC-Runtime-Library-Routines.html#OpenACC-Runtime-Library-Routines" accesskey="5">OpenACC Runtime Library Routines</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The OpenACC runtime application
                               programming interface.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="OpenACC-Environment-Variables.html#OpenACC-Environment-Variables" accesskey="6">OpenACC Environment Variables</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Influencing OpenACC runtime behavior with
                               environment variables.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="CUDA-Streams-Usage.html#CUDA-Streams-Usage" accesskey="7">CUDA Streams Usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Notes on the implementation of
                               asynchronous operations.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="OpenACC-Library-Interoperability.html#OpenACC-Library-Interoperability" accesskey="8">OpenACC Library Interoperability</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">OpenACC library interoperability with the
                               NVIDIA CUBLAS library.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="The-libgomp-ABI.html#The-libgomp-ABI" accesskey="9">The libgomp ABI</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Notes on the external ABI presented by libgomp.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Reporting-Bugs.html#Reporting-Bugs">Reporting Bugs</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to report bugs in the GNU Offloading and
                               Multi Processing Runtime Library.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Copying.html#Copying">Copying</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">GNU general public license says
                               how you can copy and share libgomp.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License">GNU Free Documentation License</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
                               How you can copy and share this manual.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Funding.html#Funding">Funding</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to help assure continued work for free 
                               software.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Library-Index.html#Library-Index">Library Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Index of this documentation.
</td></tr>
</table>



<hr>
<div class="header">
<p>
Next: <a href="Enabling-OpenMP.html#Enabling-OpenMP" accesskey="n" rel="next">Enabling OpenMP</a>, Up: <a href="../dir/index.html" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Library-Index.html#Library-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
